package com.jrx.anytxn.customer.dto.bankcardinfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jrx.anytxn.common.constant.RegexConstant;
import com.jrx.anytxn.customer.dto.BaseApiReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.FutureOrPresent;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * 银行卡绑定API输入字段
 *
 * @author 90443
 * @date 2019-07-18 15:39
 **/
@ApiModel(description="银行卡绑定API请求字段BankCardBindReq")
public class BankCardBindReq extends BaseApiReq implements Serializable {

    private static final long serialVersionUID = 5725408676821040505L;

    /**
     * 银行卡号
     * 表字段:cardNumber
     */
    @ApiModelProperty(value="银行卡号",example="6228480028285916852",required=true)
    @NotNull(message = "银行卡绑定API请求银行卡号不能为空")
    @Pattern(regexp = RegexConstant.BANKCARD_NUMBER,message = "银行卡号格式不正确(15到20位或9位)")
    private String cardNumber;
    /**
     * 银行预留手机号
     * 表字段:mobile
     */
    @ApiModelProperty(value="银行预留手机号",example="13521472344",required=true)
    @Pattern(regexp = RegexConstant.MOBILE_FORMAT,message = "输入手机号格式不正确")
    private String mobile;
    /**
     * 绑定类型
     * 表字段:bindType
     */
    @ApiModelProperty(value="绑定类型",example="1",required=true)
    @NotBlank(message = "银行卡绑定API请求绑定类型不能为空")
    @Pattern(regexp = RegexConstant.BANKCARD_BINDTYPE,message = "绑定类型只能0,1,2,3")
    private String bindType;
    /**
     * 协议号
     * 表字段:contractId
     */
    @ApiModelProperty(value="协议号",example="1",required=true)
    @NotBlank(message = "银行卡绑定API请求协议号不能为空")
    private String contractId;
    /**
     * 协议签署日期
     * 表字段:contractSignDate
     */
    @ApiModelProperty(value="协议签署日期",example="2019-07-24",required=true)
    @JsonFormat( pattern="yyyy-MM-dd")
    private Date contractSignDate;
    /**
     * 协议到期日期
     * 表字段:contractExpireDate
     */
    @ApiModelProperty(value="协议到期日期",example="2020-07-24",required=true)
    @FutureOrPresent(message = "协议到期日期必须为将来或者现在的时间")
    @JsonFormat( pattern="yyyy-MM-dd")
    private Date contractExpireDate;
    /**
     * 银行id
     * 表字段:bankId
     */
    @ApiModelProperty(value="银行id",example="001",required=true)
    @NotBlank(message = "银行卡绑定API请求银行ID不能为空")
    private String bankId;
    /**
     * 银行名称
     * 表字段:bankName
     */
    @ApiModelProperty(value="银行名称",example="北京银行",required=true)
    @NotBlank(message = "银行卡绑定API请求银行名称不能为空")
    private String bankName;
    /**
     * 分行所在城市
     * 表字段:bankCity
     */
    @ApiModelProperty(value="分行所在城市",example="北京",required=true)
    private String bankCity;
    /**
     * 卡片类型
     * 表字段:cardType
     */
    @ApiModelProperty(value="卡片类型",example="1",required=true)
    @NotBlank(message = "银行卡绑定API请求卡片类型不能为空")
    private String cardType;
    /**
     * 单次扣款限额
     * 表字段:limit
     */
    @ApiModelProperty(value="单次扣款限额",example="1",required=true)
    private String limit;


    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getBindType() {
        return bindType;
    }

    public void setBindType(String bindType) {
        this.bindType = bindType;
    }

    public String getContractId() {
        return contractId;
    }

    public void setContractId(String contractId) {
        this.contractId = contractId;
    }

    public Date getContractSignDate() {
        return contractSignDate;
    }

    public void setContractSignDate(Date contractSignDate) {
        this.contractSignDate = contractSignDate;
    }

    public Date getContractExpireDate() {
        return contractExpireDate;
    }

    public void setContractExpireDate(Date contractExpireDate) {
        this.contractExpireDate = contractExpireDate;
    }

    public String getBankId() {
        return bankId;
    }

    public void setBankId(String bankId) {
        this.bankId = bankId;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankCity() {
        return bankCity;
    }

    public void setBankCity(String bankCity) {
        this.bankCity = bankCity;
    }

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public String getLimit() {
        return limit;
    }

    public void setLimit(String limit) {
        this.limit = limit;
    }

    @Override
    public String toString() {
        return "BankCardBindReq{" +
                ", cardNumber='" + cardNumber + '\'' +
                ", mobile='" + mobile + '\'' +
                ", bindType='" + bindType + '\'' +
                ", contractId='" + contractId + '\'' +
                ", contractSignDate='" + contractSignDate + '\'' +
                ", contractExpireDate='" + contractExpireDate + '\'' +
                ", bankId='" + bankId + '\'' +
                ", bankName='" + bankName + '\'' +
                ", bankCity='" + bankCity + '\'' +
                ", cardType='" + cardType + '\'' +
                ", limit='" + limit + '\'' +
                '}';
    }
}
